package com.zmc.lostfound.common.feign;

import com.zmc.lostfound.common.dto.SimpleEmailDTO;
import com.zmc.lostfound.common.dto.SmsSendCaptchaDTO;
import com.zmc.lostfound.common.feign.fallback.ThirdPartyFallbackFactory;
import com.zmc.lostfound.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author ZMC
 * @description thirdparty第三方服务远程调用接口
 */
@FeignClient(value = "lostfound-thirdparty", fallbackFactory = ThirdPartyFallbackFactory.class)
public interface ThirdPartyFeign {

    /**
     * 发送短信验证码
     *
     * @param smsSendCaptchaDTO 发送短信验证码请求体
     * @return Result
     */
    @PostMapping("/thirdparty/sms/sendCaptcha")
    Result sendSmsCaptcha(@RequestBody @Validated SmsSendCaptchaDTO smsSendCaptchaDTO);

    /**
     * 发送简单QQ邮件
     *
     * @param simpleEmailDTO 发送简单邮件传输对象
     * @return Result
     */
    @PostMapping("/thirdparty/email/sendSimpleEmail")
    Result sendSimpleEmail(@RequestBody @Validated SimpleEmailDTO simpleEmailDTO);

}
